package com.wgchao.amc.controller.autho;

import com.wgchao.amc.common.AuthoMenuInfo;
import com.wgchao.amc.common.MenuAutho;
import com.wgchao.amc.common.ResultCommon;
import com.wgchao.amc.service.AuthoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: AuthoController
 * @author: wgchao
 * @createTime: 2019/10/31 11:16 AM
 * @Description: 权限管理-综合
 */
@RestController
@RequestMapping("/amc/sys/autho/integrate")
@Api(tags = "权限管理-综合")
public class AuthoController {
    @Autowired
    private AuthoService authoService;

    @GetMapping("/search/{userId}/{proMark}")
    @ApiOperation(value = "查询用户菜单权限-可能存在重复(部门、角色、用户可能同时拥有某个菜单的权限，但是可能菜单的功能权限不同)")
    @MenuAutho(desc = "查询用户菜单权限")
    public ResultCommon<List<AuthoMenuInfo>> searchMenusOfUser(@PathVariable Long userId,
                                                               @PathVariable String proMark) throws Exception{
        return authoService.searchMenusOfUser(userId, proMark);
    }
}
